package auctionhaus


class CloseListingsJob {
    def listingService
    
    static triggers = {
        simple name: 'mySimpleTrigger', startDelay: 10000, repeatInterval: 5000
    }

    def execute() {
        def listings = Listing.closedListings.findAllWhere(isClosed: false)
        if (listings.size() > 0)  {
            listings.each() {item -> listingService.closeListing(item) }
        }
    }
}
